package giraronRuleta;

import java.util.List;

import jugador.Jugador;

import org.apache.wicket.Session;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.AbstractReadOnlyModel;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.PropertyModel;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import ruletaPage.TableroPage;

import applications.RuletaApplication;
import apuesta.Apuesta;

import Ruleta.Ruleta;

public class GiraronLaRuletaPage extends WebPage{
	
	private static final long serialVersionUID = 1L;

	
	public GiraronLaRuletaPage() {

		
		IModel<Integer> model = new AbstractReadOnlyModel<Integer>() {

			@Override
			public Integer getObject() {
				return RuletaApplication.getInstance().getMesa().getNumeroActual();
				
			}
		};
		add(new Label("ganador", model));
		seguirJugando();

	}

	private void seguirJugando() {
		
		@SuppressWarnings("serial")
		Form<String> seguirJugando = new Form<String>("seguirJugandoForm"){
			
			public void onSubmit(){
				Jugador j=(Jugador) Session.get().getAttribute("jugador");
				Jugador agregar=RuletaApplication.getInstance().ubicarJugador(j);
				setResponsePage(new TableroPage(agregar));
			};
			
		};
		add(seguirJugando);
		
	}

}
